<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org 
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\model\api;

use laytp\BaseModel;
class GenshinRelics extends BaseModel
{

    /**
     * 获取所有圣遗物
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getAllRelics(){
        $list = $this->field('id,relics_name,icon,star')
            ->cache(true)
            ->select()->toArray();
        return $list;
    }

    /**
     * 根据id获取圣遗物信息
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getRelicsInfo(){
        $list = $this->cache(true)
            ->column('icon,star','relics_name');
        return $list;
    }



}